package com.sinry.user.controller;

import com.sinry.common.core.domain.vo.UserVo;
import com.sinry.common.log.utils.TraceIdUtil;
import com.sinry.user.services.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author linxinlei
 * @project sinry-cloud
 * @description 用户访问
 * @date 2022/5/6
 **/
@Slf4j
@Api(tags = "用户数据")
@RequestMapping("/user")
@RestController
public class UserController{

    public final IUserService userService;

    public UserController(IUserService userService) {
        this.userService = userService;
    }

    @ApiOperation(value = "获取用户信息")
    @GetMapping("/get")
    public UserVo getUser() {
        log.info("MDC-service: {}", TraceIdUtil.getTraceId());
        return userService.getUsers();
    }

}
